<?php 
class mycity{
	function count_rowall($query) {
		$qr = mysql_query($query) or die(mysql_error());
		$qn = mysql_num_rows($qr);
		return $qn;
	}
	function select($query) {
		$qr = mysql_query($query) or die(mysql_error());
		$qn = mysql_num_rows($qr);
		return $qn;
	}
	function change_status($table,$id,$status) {
		
		if($status==1){
			$qr = mysql_query("UPDATE `".$table."` SET `status`='".$status."' WHERE `id`='".$id."' ") or die(mysql_error());
			if($qr){ return 1; }else{ return 0;}	
		}else if($status==2){
			//$user=get_allitem($table,'id',$id);
			//unlink("../".$user['']);
			$qr = mysql_query("DELETE FROM `".$table."` WHERE `id`='".$id."' ") or die(mysql_error());
			if($qr){ return 2; 
				/*$user=get_allitem($table,'id',$id);
				$msg=$user['image'].'This is deleted from your url!';
				mysql_query("INSERT INTO `my_msg` SET `userid`='".$user."',`msg`='' WHERE `id`='".$id."' ") or die(mysql_error());*/
			}else{ return 0;}
		}
	}
	function delete($table,$id,$status){
		if($table=="my_images"){
			$user=get_allitem($table,'id',$id);
		}else if($table=="my_url"){
			
		}else if($table=="my_article"){
			
		}else if($table=="my_page_details"){
			
		}
	}
}
?>